import dayjs from 'dayjs'

export function dateFormat(value, format) {
  if (value) {
    return dayjs(value).format(format)
  } else {
    return value
  }
}

export function imgPath(value) {
  return process.env.VUE_APP_BASE_API + process.env.VUE_APP_FILE_PATH + value
}

export function imgStringPath(value) {
  let str = ''
  if (value != '' && value != null && value != undefined) {
    let a = value.match(/(\;)/)
    str = value.split(';')[0]
  } else {
    str = ''
  }

  return process.env.VUE_APP_BASE_API + str
}
